<template>
	<view class="big">
		<view class="box" v-for="(item,index) in moreData" @click="goDetail(item.courseId)" :key="index-1000">
			<image class="image" :src="item.bannerFileUrl"></image>
			<view class="word">
				{{item.courseTitle}}
			</view>
		</view>
	</view>
</template>

<script>
	import {getPost} from "../../api/index.js" 
	export default {
		data() {
			return {
				moreData:""
			};
		},
		methods:{
			goDetail(data){
				// console.log(data)
				uni.navigateTo({
					url:`/pages/detail/detail?id=${data}`
				})
			},
		},
		onLoad(data) {
			console.log(data.id)
			if(data.id==1){
				getPost("/weChat/applet/course/list/type",{
					type:"boutique",pageNum:1,pageSize:10
				}).then(res=>{
					console.log(res.data.rows)
					this.moreData=res.data.rows
				})
			}else{
				getPost("/weChat/applet/course/list/type",{
					type:"free",pageNum:1,pageSize:10
				}).then(res=>{
					console.log(res.data.rows)
					this.moreData=res.data.rows
				})
			}
		
		}
	}
</script>

<style lang="less" scoped>
.box{
	margin-bottom: 15rpx;
	display: flex;
	.word{
		width: 400rpx;
		margin-left: 15rpx;
	}
}
.big{
	padding: 15rpx;
}
.image{
	width: 250rpx;
	height: 150rpx;
}

</style>
